#include "Comm.hpp"
#include "Time.hpp"
#include "FIFO.hpp"
#include <iostream>

int main()
{
    shm.GetShm();
    shm.AttchShm();
    gpipe.OpenPipeForWrite();//a打开管道 
    // client发送数据
    struct data* image = (struct data*)shm.GetAdder();
    while(true)
    {
        strcpy(image->status,"最新");
        strcpy(image->lasttime,GetCurrTime().c_str());
        strcpy(image->image,"xxxxxxxxxxxxxxx");
        gpipe.Signal();
        sleep(3);
    }

    shm.DattchShm();

    return 0;
}

//v1
// int main()
// {
//     shm.GetShm();
//     shm.AttchShm();
    
//     // client发送数据
//     char *msg = (char *)shm.GetAdder();
//     strcpy(msg, "hello server!");
//     printf("client的虚拟地址:%p\n",msg);

//     shm.DattchShm();

//     return 0;
// }